import {createApp} from 'vue'
import './style.css'
import App from './App.vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
// 导入plus-pro-components 及其样式
import PlusProComponents from 'plus-pro-components'
import 'plus-pro-components/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue';
import router from './router';

const app = createApp(App);
import zhCn from 'element-plus/es/locale/lang/zh-cn'
// import en from 'element-plus/es/locale/lang/en'
import plusZhCn from 'plus-pro-components/es/locale/lang/zh-cn'
import {createPinia} from "pinia";
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate';
import {Download, Upload} from "@element-plus/icons-vue";

app.use(ElementPlus, {
    locale: {...zhCn, ...plusZhCn}
})
//创建一个Pinia实例,用于在应用中集中管理状态(store)
const pinia = createPinia()
pinia.use(piniaPluginPersistedstate); // 启用持久化
app.use(pinia)
app.use(router);

// 使用
app.use(PlusProComponents)
// 注册所有图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component);
}
app.component('ElIconDownload', Download)
app.component('ElIconUpload', Upload)
app.mount('#app')
